﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BakalarskaPraca.Generation.Data;
using BakalarskaPraca.Generation.Tasks.Abstract;
using BakalarskaPraca.Interfaces;

namespace BakalarskaPraca.Generation.Tasks
{
    public class HumidityConstantHumidity : GenerationProcess
    {
        public int HumidityValue;

        public HumidityConstantHumidity(List<HumidityPolygon> polygons, ModelData modelData) : base(polygons, modelData)
        {
            this.HumidityValue = 0;
        }

        public override void Run(IProgressReporter reporter)
        {
            int i = 0;
            int count = this.Polygons.Count;
            this.Polygons.ForEach(
                polygon =>
                    {
                        polygon.SetHumidityLevel((byte)this.HumidityValue);
                        reporter.ReportProgress(i++, count);
                    });
        }

        public override string ToString()
        {
            return "Humidity: Constant Humidity";
        }
    }
}
